﻿#pragma once

namespace xi
{

namespace utils
{

template <typename T> class Singleton
{
  public:
    /**
     * @brief 构造单例
     *
     * @return T&
     */
    static T &instance()
    {
        static T instance;
        return instance;
    }

  private:
    Singleton() = default;
    ~Singleton() = default;
    Singleton(const Singleton &) = delete;
    Singleton &operator=(const Singleton &) = delete;
};

} // namespace utils

} // namespace xi
